import React from 'react';
// import moment from 'moment';
import {  SearchOutlined, ReloadOutlined } from '@ant-design/icons';
import { Form, Input, Button, message, Row ,Col} from 'antd';
// import FoldSearchPanle from '@/components/FoldSearchPanle';

const SearchOrder =({
    defaultParams={},
    onSearch={},
    onReset={},
    children={},
}) =>{
  
  // const [fold, setFold] = useState(true);
    const [form] = Form.useForm();
    const search =(values:any)=>{
       if (typeof onSearch === 'function'){
           onSearch(values)
       }
    };
    const handleReset=()=>{
        form.resetFields();
        message.success('重置完成');
        if (typeof onReset === 'function') {
          onReset();
        }
    };

    return (
        <Form form={form} initialValues={defaultParams} onFinish={search} 
        >
           
        <Row gutter={16}>
          <Col span={8}>
             <Form.Item name="id" label="订单编号" >
          <Input  placeholder="请输入产品编码" />
        </Form.Item>
          </Col>
          <Col>
          <Form.Item >
          <span style={{ float: 'right' }}>
            <Button.Group style={{ margin: '0 12px' }}>
              <Button
                type="primary"
                icon={<SearchOutlined />}
                htmlType="submit"
                title="查询"
                style={{ zIndex: 3 }}
              >
                查询
              </Button>
              <Button icon={<ReloadOutlined />} onClick={handleReset} title="重置">
                重置
              </Button>
            </Button.Group>
            {children}
          </span>
        </Form.Item>
          </Col>
        </Row>
        </Form>
    )
};
export default SearchOrder;